package com.wodsy.phoenix.dataservice.orderc.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.wodsy.phoenix.datadao.base.IBaseDao;
import com.wodsy.phoenix.datadao.orderc.dao.OrderDao;
import com.wodsy.phoenix.dataobject.base.Pager;
import com.wodsy.phoenix.dataobject.orderc.model.Order;
import com.wodsy.phoenix.dataobject.orderc.vo.BuyerOrderSearchReq;
import com.wodsy.phoenix.dataservice.base.AbstractBaseService;
import com.wodsy.phoenix.dataservice.orderc.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

/**
 * 名称：com.wodsy.orderc.dataservice.service.impl
 * 描述：<br>
 * 类型：JAVA<br>
 * 最近修改时间：2015-05-20<br>
 *
 * @author jiawenfeng
 * @since 2015-05-20
 */
@Service(interfaceClass = OrderService.class, interfaceName = "com.wodsy.phoenix.dataservice.orderc.service.OrderService")
public class OrderServiceImpl extends AbstractBaseService<Order, Long> implements OrderService {


    @Autowired
    private OrderDao orderDao;

    @Override
    protected IBaseDao<Order, Long> getIBaseDao() {
        return orderDao;
    }


    @Transactional(readOnly = true)
    public Pager<Order> findBySearchCondition(Pager<Order> orderPager, BuyerOrderSearchReq buyerOrderSearchReq) {
        Pager<Order> bySearchCondition = orderDao.findBySearchCondition(orderPager, buyerOrderSearchReq);
        return bySearchCondition;
    }

    @Override
    @Transactional(readOnly = true)
    public Order findOderByOrderNo(Long orderId) {
        return orderDao.findByOrderId(orderId);
    }


    //启动duboo
    public static void main(String[] args) {
        com.alibaba.dubbo.container.Main.main(args);
    }
}
